package com.likersai.opon.system.exception;

import com.likersai.opon.constant.MsgAndCode;

/**
 * 自定义报错
 *
 * @author sun.ye
 * @since 2021-02-25 23:28
 */
public class OponException extends RuntimeException {
    private final MsgAndCode msgCode;

    public OponException(MsgAndCode msgCode) {
        super(msgCode.getMessage());
        this.msgCode = msgCode;
    }

    public String getCode(){
        return msgCode.getCode();
    }

    public MsgAndCode getMsgCode() {
        return msgCode;
    }
}